const usersDao=require('../dao/usersDao');

//查询所有
module.exports.findSeach = async function (searchObj) {
    return await usersDao.findSeach(searchObj)
}
// 
module.exports.findAll = async function () {
    return await usersDao.findAll()
}

//添加
module.exports.insert = async function (users) { 
    return await usersDao.insert(users)
}

// 删除
module.exports.delete=async function(id){
    return await usersDao.delete(id)
}

// 删除
module.exports.updata=async function(id,users){
    return await usersDao.delete(id,users)
}

module.exports.login = async function (id) {
    let data= await usersDao.login(id)
        try{
            return data
        }catch{
            return {}
        }
}

module.exports.register = async function (userObj) {
    return await usersDao.register(userObj)
}